home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
os2
/
srefv112.zip
/
FILTINST.80
< prev
next >
Wrap
Text File
|
1996-05-29
|
48KB
|
1,183 lines
/* 5/96. this is the SRE-FILTER configuration routine */
/* to add variables:
1) Create a new Param.nn line (say, Param.30='NEW_CONTROL')
2) Create a new set of output lines in the DISPLAY THEM section
3) Create a new set of output lines in the CHANGE THEM section
*/
filtinst:
parse arg ddir ,tempfile, sel, list, verb, uri, user, basedir, workdir
list=translate(list, ' ', '+'||'090a0d'x) /* Whitespace, etc. */
CHECKIT=1 /* Change this to 0 if you want to enable REMOTE configuration */
if checkit<>1 then signal nocheck /* skip client=server security check */
/* only if user = serveraddress !!! */
who2=extract('CLIENTADDR')
saddr2=extract('SERVERADDR')
if who2<>saddr2 then do
call lineout tempfile, '<!doctype html public "-//IETF//DTD HTML 3.0//EN">'
call lineout tempfile, "<html><head><title>SREFILTER ERROR </title>"
call lineout tempfile, "</head><body>"
call lineout tempfile,' <strong> Action not allowed remotely.</strong> <pre>'
call lineout tempfile,' </body> </html> '
call lineout tempfile
return 'FILE ERASE TYPE text/html NAME' tempfile
end
nocheck: nop
/* go get initfilt */
aport=extract(serverport)
afile=basedir||"\INITFILT."||aport
/* IF THE VERB IS POST-- THEN THIS IS A "WRITE INFO CALL
IF IT'S GET, THEN ITS A "SHOW INFO" OR "LET ME CHANGE INFO" CALL
*/
if translate(verb)="POST" then signal write_it
/* IF HERE, VERB=GET --- so show vars or request changes */
parse upper var list foo '=' todo
/* read initfilt.80 file into internal storage */
FOO=fileREAD(AFILE,'FILELINES',,'E')
IF FOO=0 THEN DO
SAY " FILTINST ERROR: COULD NOT READ INITFILT FILE "
RETURN String ' Error reading initfilt file '
end
header1=stuff
/* convert < to < and > to > */
crlf = '0d0a'x
i=0
do mm=1 to filelines.0
big=filelines.mm
if big <>" " then do
i=i+1
flines.i.orig=big
big=sref_replacestrg(big,'<','<','all')
big=sref_replacestrg(big,'>','>','all')
flines.i=big
end
end
flines.0=i
/* flines now contains the values of the parameters. Parse 'em out... */
/* the following is a list of parameters that we will adjust */
/* logon control variables */
param.1="checklog" /* whether require logon: NO YES ALWAYS INHOUSE*/
param.2="owners" /* list of owners */
param.3="inhouseips" /* stem variable of inhouse ips */
param.4="unallowedips" /* stem variable of unallowed ip */
/* request string modification variables */
param.5="default" /* the default page : A file name relative to ddir*/
param.6="check_alias0" /* NO=Don't, YES=DO, HTM=Check up on HTML actions only*/
param.7="home_dir" /* the ~ substitution */
param.8="auto_name" /* list of potential "default documents" for directories */
/* access and auditing variables */
param.9="allow_access" /*File specific: YES=no control, INHOUSE=inhouse only, NO=Superusrs */
param.10="record_option" /*NO=DONT, YES=DO, YES_ALL= Yes, arguments*/
param.11="no_getafile_control" /* YES=free access, INHOUSE=Inhouse users, NO=Superusers */
/* stem variables for REPLACE keyphrase */
param.12="headers" /* stem variable of headers */
param.13="footers" /* stem variable of footers */
param.14="inhouse" /* stem variables for replace inhouse. static variables */
param.15="superuser" /* stem variables for replace superuser. static variables*/
/* static variables for REPLACE keyphrase */
param.16="webmaster" /* string containing the webmasters url */
param.17="home_name" /* colloquial name of this server */
/* misc. static variables (used for a variety of internally generated messages */
param.18="inhouse_name" /* Colloquial name of "inhouse" folks*/
param.19="mess_hit_line" /* variable used with option_hit.n and option_count.n */
param.20="not_found_url" /* string returned with 404 error */
/* late additions */
param.21="INHOUSE_PRIVS"
param.22="PUBLIC_PRIVS"
param.23="PUBLIC_FILES" /* stem var of public files */
param.24="AUTO_HEADER"
param.25="UPLOAD_MAXSIZE"
param.26="UPLOAD_MINFREE"
param.27="NOEXT_TYPE"
param.28="POST_FILTER"
param.29="PRE_FILTER"
param.30="DNS_CHECK"
param.31="SMTP_GATEWAY"
param.0=31
do mm=1 to param.0
param.mm=translate(param.mm)
param.mm.nvals=0 /* it might be a stem? */
param.mm.val=" "
end
/* the following directories and files are subject to change */
fd.1="messbox_dir" /* location of message boxes (and recrdall.in in odd cases */
fd.2="tempfile_dir" /* temporary, working files, directory */
fd.3="counter_file" /* used by REPLACE HITS and REPLACE COUNTS keyphrase */
fd.4="record_all_file" /* used if record_option =YES or YES_ALL */
fd.5="sendfile_file" /* used by the SENDFILE facility*/
fd.6="access_file" /* used if ALLOW_ACCESS=YES or INHOUSE*/
fd.7="alias_file" /* list of aliases */
fd.8="repstrgs_file" /* custom written variables for REPLACE keyphrase */
fd.9="user_file" /* username/password/privileges file */
fd.10="interpret_file" /* rexx=code blocks used by the INTERPRET keyphrase */
fd.11="upload_dir" /* upload directory (used by GET_URL) */
fd.12="upload_log" /* log file for upload tracking */
fd.13="cgi_bin_dir" /* cgi-bin directory */
fd.14="virtual_file" /* file containing virtual directory information */
fd.0=14
do mm=1 to fd.0
fd.mm=translate(fd.mm)
fd.mm.val=" "
end
/* fhe following will NOT be settable by this program. Ambitious
users can go into INITFILT.80 themselves:
no_include YES means "suppress keyphrase based server side includes
(the default is NO-- which means "do the keyphrases )
delim_1.1
delim_2.1 The two sets of delimiters <!-- --> and { } used to
delim_1.2 indicate keyphrases
delim_2.2
ismap_url The "indicator phrase" used to tell SRE-FILTER that this is
a mappable image request.
map_pointdist Maximum distance that a point (in a NCSA map) for it to be
selected
servdir Location of the server (typically, \GOSERV)
*/
nno=0
/* check to see what variable this line matches with */
do mm=1 to flines.0
parse var flines.mm aname foo '=' aval
aval=strip(aval)
aval=strip(aval,,"'")
aval=strip(aval,,'"')
/* is it a stem variable */
aname0=translate(aname)
parse var aname0 aname "." anext
/* special treatment for stem variables */
if anext<>"" then anext=translate(anext) /* it's a stem variable */
igot=0
do mm2=1 to param.0
if aname=param.mm2 then do
if anext="" then do
param.mm2.val=aval
end
else do
param.mm2.val.anext=aval
param.mm2.nvals=max(param.mm2.nvals,anext)
end
igot=mm2
leave
end
end
/* if igot=0, not a variable... maybe it's a filename */
if igot=0 then do
do mm2=1 to fd.0
if aname=fd.mm2 then do
fd.mm2.val=aval
igot=mm2
leave
end
end
end
/* if igot=0, it's an unmentioned variable or filename. So, note it's existence */
if igot=0 then do
flines.mm=translate(flines.mm.orig, ' ','00090a0d'x)
IF flines.mm=" " then iterate
nno=nno+1
nochangers.nno=flines.mm
end
end
/***** ---everything is now read in ----- */
/* ************************ DISPLAY THEM --------------------------------*/
if todo="SHOW" then do
call lineout tempfile," <h2> Current Settings of SRE-FILTER's Parameters </h2> "
call lineout tempfile,"<h3> Variables and file-names that FILTINST will not change </h3>"
call lineout tempfile," <em> To change them, you'll have to edit INITFILT."aport
call lineout tempfile,' </em> <br>'
call lineout tempfile,"<p> Note that lines beginning with a ; are treated as SRE-FILTER comments <pre>"
do nn=1 to nno
dog=nochangers.nn
DOG=sref_REPLACESTRG(DOG,"<",'<','ALL')
DOG=sref_REPLACESTRG(DOG,">",'>','ALL')
call lineout tempfile,dog
end
call lineout tempfile,'</pre><p> <em> Note: REXX Comments may point to parameter-entry errors! </em> <hr width=30%> '
call lineout tempfile, ' <h3> Logon Control Variables </h3> '
do mm=1 to 4
foo=write_1(mm)
end
foo=write_1(30)
call lineout tempfile,' <h3> PUBLIC_FILES </h3> '
foo=write_1(23)
call lineout tempfile,' <h3> Request string modification variables </h3>'
do mm=5 to 8
if mm=6 then iterate
foo=write_1(mm)
end
foo=write_1(27)
call lineout tempfile,' <h3> Reponse header creation, Pre and Post filters </h3 '
foo=write_1(24)
foo=write_1(28)
foo=write_1(29)
call lineout tempfile,' <h3> File access and auditing variables </h3>'
do mm=9 to 11
foo=write_1(mm)
end
foo=write_1(21)
foo=write_1(22)
call lineout tempfile,' <h3> Stem variables for REPLACE keyphrase </h3> '
do mm=12 to 15
foo=write_1(mm)
end
call lineout tempfile,' <h3> Other variables for REPLACE keyphrase </h3>'
do mm=16 to 17
foo=write_1(mm)
end
call lineout tempfile, '<h3>Upload control, and E-Mail support, variables </h3>'
do mm=25 to 26
foo=write_1(mm)
end
foo=write_1(31)
call lineout tempfile,' <h3> Miscellanous variables (used for error messages, etc.) </h3>'
do mm=18 to 20
foo=write_1(mm)
end
call lineout tempfile,' <hr width=50%> <h3> Files and Directories .. </h3>'
do mm2=1 to 14
call lineout tempfile, " <b>" fd.mm2 "</b> =<tt> " fd.mm2.val '</tt><br>'
end
call lineout tempfile,' <hr> </body> </html> '
call lineout tempfile
end
/* **************** CHANGE THEM --------------------------------. */
else do
call lineout tempfile,'<h2> Change parameter values </h2>'
call lineout tempfile,'You can change whatever parameter values you wish. Default values'
call lineout tempfile,'are shown, and are retained if not explicitily modified.'
call lineout tempfile,'<p><em> If the explanations here are insufficient, '
call lineout tempfile,' <a href="/samples/initfilt.doc">INITFILT.DOC</a>'
call lineout tempfile,'might help!</em>'
call lineout tempfile,'<HR WIDTH=40%>'
call lineout tempfile,' <blockquote> For several of these variables, numeric IP '
call lineout tempfile,' addresses are expected. If you need to lookup a numeric address:'
call lineout tempfile,' <FORM ACTION="!host" METHOD="GET">'
call lineout tempfile,' <em> enter the IP name here and Look It Up: </em> '
call lineout tempfile,' <INPUT TYPE="text" NAME="" VALUE="" SIZE=25 MAXLENGTH=25>'
call lineout tempfile,' <INPUT TYPE="submit" VALUE=" Look It Up"> </form> <hr WIDTH=40%>'
call lineout tempfile,'</blockquote><hr> A caution: '
call lineout tempfile," do not use <code>single quote</code> (<strong>'</strong>) characters (they will cause errors)!"
call lineout tempfile,'<hr>'
call lineout tempfile,'<FORM ACTION="filtinst" METHOD="POST">'
call lineout tempfile,' <em> <A NAME="section0">Quick jumps...</A> </em> <br>'
call lineout tempfile,' <A HREF="#section1">Logon, privileges, and Public Files</A> '
call lineout tempfile,' <br><A HREF="#section2">Request string modification </A>'
call lineout tempfile,'<br><A HREF="#section3"> Access and Auditing</A> '
call lineout tempfile,' <br><A HREF="#section4">Response Header, Pre-filter and Post-Filter, and Uploading</A> '
call lineout tempfile,' <br><A HREF="#section5">String Replacements</A> '
call lineout tempfile,'<br><A HREF="#section6"> File & Directory Names</A> '
call lineout tempfile,'<p> <em> and when you are done.. </em> '
call lineout tempfile,'<INPUT TYPE="submit" VALUE="make the changes">, '
call lineout tempfile,' <em> or you can </em> '
call lineout tempfile,'<INPUT TYPE="reset" VALUE="reset to current values">'
call lineout tempfile,' <hr width=40%> '
call lineout tempfile,' <H3><a name="section1"> Logon, Privileges, and Public Files </a></H3>'
call lineout tempfile,'<dl>'
/* CHECKLOG */
call lineout tempfile,'<dt> <strong>CHECKLOG</strong>:'
v.1="NO" ; v.2="YES" ; v.3="ALWAYS" ; v.4="INHOUSE" ;
foo=do_radio(1,4)
call lineout tempfile,'<dd>'
call lineout tempfile,'CHECKLOG controls the logon-level:'
call lineout tempfile,'<ul>'
call lineout tempfile,'<LI>NO : Logon never required'
call lineout tempfile,'<LI>YES : Logon required for "empty" (home-page) requests'
call lineout tempfile,'<LI>ALWAYS : Logon required for any request'
call lineout tempfile,'<LI>INHOUSE : Only requesters with predefined, or explicitily granted (in the'
call lineout tempfile,'USERS.IN file) privileges of INHOUSE or SUPERUSER are allowed in.'
call lineout tempfile,'</ul>'
/* owners */
call lineout tempfile,'<hr><dt> <strong>OWNERS</strong>:'
call lineout tempfile,' <INPUT TYPE="text" NAME="OWNERS" '
call lineout tempfile,'value="' param.2.val '"'
call lineout tempfile,' SIZE=30 MAXLENGTH=80>'
call lineout tempfile,'<dd>'
call lineout tempfile,'OWNERS is a space delimited list of IP addresses of the OWNERS. Owners'
call lineout tempfile,'are automatically granted SUPERUSER privileges.'
call lineout tempfile,'<em>Wildcards are NOT allowed in the OWNERS list </em>'
/* INHOUEIPS.ips */
foo=""
do mm=1 to param.3.nvals
if symbol('param.3.val.mm')="VAR" then
foo=foo||param.3.val.mm||crlf
end
oo=translate(foo,' ','0')
oo=translate(oo, ' ','00090a0d'x) /* Whitespace, etc. */
if oo= " " then foo=oo
call lineout tempfile,'<hr><dt> <strong>INHOUSEIPS.</strong>:'
call lineout tempfile,' <TEXTAREA NAME="'||param.3||'." ROWS=4 COLS=25>'
call lineout tempfile,foo
call lineout tempfile,'</TEXTAREA>'
call lineout tempfile,'<dd>'
call lineout tempfile,' INHOUSEIPS. is a "stem" variable that contains the IP '
call lineout tempfile,' addresses of requesters who will be automatically granted INHOUSE privileges.'
call lineout tempfile,' <br> You should enter each of these addresses on a <bold>;seperate line </bold> .'
call lineout tempfile,' <em> Wildcards (the * character) are allowed</em>'
call lineout tempfile,' <p> In addition, you can put (optional) INHOUSEIP. privileges after the '
call lineout tempfile, ' the IP address. '
call lineout tempfile,' <BR> Examples: <ul> <li> 152.22.12.* <li>515.21.512.51 VIEWMESS PROJ1'
call lineout tempfile,' <li>551.21.512.* </ul> '
call lineout tempfile, ' <br> Note that 515.21.512.51 is granted VIEWMESS and PROJ1 privileges '
call lineout tempfile, " (in addition to the INHOUSE_PRIV's privleges) "
/*INHOUSE_PRIVS*/
call lineout tempfile,'<hR><dt> <strong>INHOUSE_PRIVS</strong>:'
call lineout tempfile,' <INPUT TYPE="text" NAME="INHOUSE_PRIVS" '
call lineout tempfile,'value="' param.21.val '"'
call lineout tempfile,' SIZE=30 MAXLENGTH=80>'
call lineout tempfile,'<dd> INHOUSE_PRIVS is a space delimited list of "extra"'
call lineout tempfile,' privileges to give to OWNERS and to IN-HOUSE requesters.'
call lineout tempfile,' <br>It is <em> highly</em> recommended that <strong>INHOUSE</strong>'
call lineout tempfile,' be included in this list! <p>'
call lineout tempfile,' Example: if you want to give all IN-HOUSE requesters '
call lineout tempfile,' message-box reading privileges, add VIEWMESS to this list.'
/*PUBLIC_PRIVS*/
call lineout tempfile,'<hR><dt> <strong>PUBLIC_PRIVS</strong>:'
call lineout tempfile,' <INPUT TYPE="text" NAME="PUBLIC_PRIVS" '
call lineout tempfile,'value="' param.22.val '"'
call lineout tempfile,' SIZE=30 MAXLENGTH=80>'
call lineout tempfile,'<dd> PUBLIC_PRIVS is a space delimited list of "extra" '
call lineout tempfile,' privileges to give to everyone. '
/* Unallowed ips */
foo=""
do mm=1 to param.4.nvals
if symbol('param.4.val.mm')="VAR" then
foo=foo||param.4.val.mm||crlf
end
oo=translate(foo,' ','0')
oo=translate(oo, ' ','00090a0d'x) /* Whitespace, etc. */
if oo= " " then foo=oo
call lineout tempfile,'<hr><dt> <strong>UNALLOWEDIPS.</strong>:'
call lineout tempfile,' <TEXTAREA NAME="'||param.4||'." ROWS=4 COLS=25>'
call lineout tempfile,foo
call lineout tempfile,'</TEXTAREA>'
call lineout tempfile,'<dd>'
call lineout tempfile,' UNALLOWEDIPS. is the "opposite" of INHOUSEIPS. It is a list of '
call lineout tempfile,' the IP addresses of requesters who will NOT be allowed access.'
call lineout tempfile,' Note INHOUSEIPS. and OWNERS takes precedence over UNALLOWEDIPS.'
call lineout tempfile,' Thus, entering *.*.*.* as an UNALLOWEDIPS. will keep everyone, except '
call lineout tempfile,' OWNERS and INHOUSE requesters, out! '
/* DNS_CHECK */
call lineout tempfile,'<hr><dt> <strong>DNS_CHECK</strong>:'
v.1="NO" ; v.2="YES"
foo=do_radio(30,2)
call lineout tempfile,'<dd>'
call lineout tempfile,'DNS_CHECK controls whether a domain name check should occur:'
call lineout tempfile,'<ul>'
call lineout tempfile,"<LI>NO : Do not check the user's <tt> IP Name </tt> "
call lineout tempfile,"<LI>YES : Get the user's <tt> IP Name </tt> (by calling the DNS), and deny access if not found"
call lineout tempfile,'</ul>'
call lineout tempfile,' DNS_CHECK=YES provides extra security, but will slow response time '
call lineout tempfile, ' (and may keep out legitimate clients with faulty DNS servers).'
/* public files */
foo=""
do mm=1 to param.23.nvals
if symbol('param.23.val.mm')="VAR" then
foo=foo||param.23.val.mm||crlf
end
oo=translate(foo,' ','0')
oo=translate(oo, ' ','00090a0d'x) /* Whitespace, etc. */
if oo= " " then foo=oo
call lineout tempfile,'<hr><dt> <strong>PUBLIC_FILES.</strong>:'
call lineout tempfile,' <TEXTAREA NAME="'||param.23||'." ROWS=4 COLS=25>'
call lineout tempfile,foo
call lineout tempfile,'</TEXTAREA>'
call lineout tempfile,'<dd>'
call lineout tempfile,' PUBLIC_FILES. is a "stem" variable that contains a '
call lineout tempfile,' list of "publically accessible URLs". These URLs '
call lineout tempfile,'will be available to all requesters -- no logon or '
call lineout tempfile,'access control is attempted when PUBLIC_FILES are requested.<br>'
call lineout tempfile,'PUBLIC_FILES. entry may include * (for wildcard matching). <br>'
call lineout tempfile,' <em> Note that PUBLIC_FILES. entries will be checked against your ALIASES)</em>'
call lineout tempfile,'</dl> '
call lineout tempfile,' <hr width=40%> '
call lineout tempfile,' <A HREF="#section0"><EM>go to top of document</EM></A> '
call lineout tempfile,' <hr width=40%> '
call lineout tempfile,' <H3><A name="section2">Request String Modification </a3> </H3>'
call lineout tempfile,' <dl> '
/* DEFAULT */
call lineout tempfile,'<p> <dt> <strong>DEFAULT</strong>:'
call lineout tempfile,' <INPUT TYPE="text" NAME="DEFAULT" '
call lineout tempfile,'value="' param.5.val '"'
call lineout tempfile,' SIZE=30 MAXLENGTH=80>'
call lineout tempfile,'<dd>'
call lineout tempfile,' Enter the name of the HTML document to be used as your '
call lineout tempfile,' "default document" (your home page). This will be used '
call lineout tempfile,' when an empty request string is recieved. <br>Note that '
call lineout tempfile,' INDEX.HTM (located in the root of your "data directory") '
call lineout tempfile, ' is often used as the default document.'
/* CHECK_ALIAS */
/************** make it not easy to change .
call lineout tempfile,'<dd>'
call lineout tempfile,'<hr><dt> <strong>CHECK_ALIAS</strong>:'
v.1="YES" ; v.2="NO" ; v.3="HTM"
foo=do_radio(6,3)
call lineout tempfile,'<dd>CHECK_ALIAS is used to turn on and off the ALIAS checking feature '
call lineout tempfile,'of SRE-FILTER:'
call lineout tempfile,' <UL> <LI> YES = Check all "actions" '
call lineout tempfile,'<LI> HTM = Check requests for HTML documents '
call lineout tempfile,'<LI> NO = Do NOT check </ul>'
call lineout tempfile,' Note that the ALIASES_FILE (set below) will contain your list of ALIASES.'
***********/
/* HOME_DIR */
call lineout tempfile,'<hR><dt> <strong>HOME_DIR</strong>:'
call lineout tempfile,' <INPUT TYPE="text" NAME="HOME_DIR" '
call lineout tempfile,'value="' param.7.val '"'
call lineout tempfile,' SIZE=30 MAXLENGTH=80>'
call lineout tempfile,'<dd>'
call lineout tempfile,' HOME_DIR is used when a ~ appears in the request string. '
call lineout tempfile,' Typically, it is a shorthand for a "home directory" --'
call lineout tempfile,' under which personal subdirectories are placed.'
/* NOEXT_TYPE */
call lineout tempfile,'<hR><dt> <strong>NOEXT_TYPE</strong>:'
v.1="NO" ; v.2="DIR" ; v.3="HTM" ; v.4="HTML"
foo=do_radio(27,4)
call lineout tempfile,'<dd> NOEXT_TYPE controls how SRE-FILTER handles request that '
call lineout tempfile,' have no extension, that do not have a ? in them, and that do not '
call lineout tempfile,' end with a /. <ul> <li> NO : Use as is '
call lineout tempfile,' <li>DIR: Treat as directories (append a / to the end) '
call lineout tempfile,' <li> HTM or HTML : Treat as HTML documents (append a '
call lineout tempfile,' .HTM or a .HTML respectively) </ul>'
/* AUTO_NAME */
call lineout tempfile,'<hR><dt> <strong>AUTO_NAME</strong>:'
call lineout tempfile,' <INPUT TYPE="text" NAME="AUTO_NAME" '
call lineout tempfile,'value="' param.8.val '"'
call lineout tempfile,' SIZE=30 MAXLENGTH=80>'
call lineout tempfile,'<dd>'
call lineout tempfile,' AUTO_NAME is a space delimited list of "default document for directories".'
call lineout tempfile,' It is used when <code>NOEXT_TYPE=DIR</code>, and a request for a '
call lineout tempfile, 'directory name (an <code>action</code> that ends with a /) is recieved.'
call lineout tempfile,' <br> Notes: <menu> <li> a *.HTM (or *.HTML) means "use a file called directory_name.htm (or .html) " '
call lineout tempfile, ' (if it exists in the requested directory) '
call lineout tempfile,' <li> !CREATE means "create a list of links to each file in the directory '
call lineout tempfile,' <li> !CREATE* is the same as !CREATE, but include subdirectories also </menu>'
call lineout tempfile,'</dl> '
call lineout tempfile,' <hr width=40%> '
call lineout tempfile,' <A HREF="#section0"><EM>go to top of document</EM></A> '
call lineout tempfile,' <hr width=40%> '
call lineout tempfile,'<H3><A name="section3"> Access and Auditing </a></H3>'
call lineout tempfile,'<dl> '
/* ALLOW_ACCESS */
call lineout tempfile,'<p><dt> <strong>ALLOW_ACCESS</strong>:'
v.1="YES" ; v.2="INHOUSE" ; v.3="NO"
foo=do_radio(9,3)
call lineout tempfile,'<dd>ALLOW_ACCESS turns on and off "action" specific access control'
call lineout tempfile,' <ul> <LI>YES = Do not check (allow all requests to go through'
call lineout tempfile,' <LI> INHOUSE = Check access privileges of everyone except OWNERS or INHOUSE requesters.'
call lineout tempfile,' <LI> NO = Check access privileges of everyone except OWNERS '
call lineout tempfile, ' (those with SUPERUSER privileges) </ul>'
call lineout tempfile,' Notes: <menu><li> ALLOW_ACCESS uses the ACCESS_FILE to store file-specific access information'
call lineout tempfile,' <li> The <var>SSI_ALLOW</var> (and <var>SSP_ALLOW</var>) variable controls if server side includes (processing) '
call lineout tempfile,' are permittted (on a file-by-file basis). </ul>'
/* no_getafile_control */
call lineout tempfile,'<hr><dt> <strong>NO_GETAFILE_CONTROL</strong>:'
v.1="YES" ; v.2="INHOUSE" ; v.3="NO"
foo=do_radio(11,3)
call lineout tempfile,'<dd>NO_GETAFILE_CONTROL controls the availability of the GETAFILE file display facility'
call lineout tempfile,' <ul> <LI>YES = No controls, everyone can use it.'
call lineout tempfile,' <LI> INHOUSE = Only INHOUSE users and OWNERS (SUPERUSERS) can use GETAFILE '
call lineout tempfile,' <LI> NO = Only OWNERS (SUPERUSERS) can use GETAFILE.</ul>'
call lineout tempfile,' Note that you can accomplish the same thing through careful use of ALIASES '
call lineout tempfile,' or via an entry in ALL_FILE '
call lineout tempfile,' (you may also want to investigate the use of the SENDFILE option in GETAFILE)'
/*RECORD_OPTION */
call lineout tempfile,'<hr><dt> <strong>RECORD_OPTION</strong>:'
v.1="YES" ; v.2="YES_ALL" ; v.3="NO"
foo=do_radio(10,3)
call lineout tempfile,'<dd> RECORD_OPTION turns on and off "recording all requests"'
call lineout tempfile,' <ul> <LI>YES = Record all requests, but remove arguments (such as <code>?xxx</code>) first'
call lineout tempfile,' <LI>YES_ALL = Record all requests, but do not remove "arguments" '
call lineout tempfile,' (this can lead to a lot of unique entries!) '
call lineout tempfile,' <LI> NO = Do not record all requests </ul>'
call lineout tempfile,' Notes: <br>'
call lineout tempfile,' i) RECORD_OPTIONS uses the RECORD_ALL_FILE to keep track of the number '
call lineout tempfile,' of requests recieved, and the date of the most recent request.<br>'
call lineout tempfile,' ii) Requests that are not "honored" (due to logon or access constraints) are NOT recorded'
call lineout tempfile,'</dl> '
call lineout tempfile,' <hr width=40%> '
call lineout tempfile,' <A HREF="#section0"><EM>go to top of document</EM></A> '
call lineout tempfile,' <hr width=40%> '
call lineout tempfile,' <H3><a name="section4">Response Header, Pre-filter, and Uploading </a></H3>'
call lineout tempfile,' <dl> '
/*AUTO_HEADER */
call lineout tempfile,'<p><dt> <strong>AUTO_HEADER</strong>:'
v.1="NO" ; v.2="HEAD" ; v.3="ALWAYS"
foo=do_radio(24,3)
call lineout tempfile,'<dd> AUTO_HEADER controls the "automatic creation of response headers"'
call lineout tempfile,'<ul> <LI>NO = Do not create additional response headers '
call lineout tempfile,'<LI>HEAD = Automatic creation of response headers for HEAD requests'
call lineout tempfile,'<LI>ALWAYS= Automatic creation of response headers fo GET and HEAD requests'
call lineout tempfile,'</ul> Note: When active, LINK and META HTTP-EQUIV elements found in the '
call lineout tempfile,'<HEAD> portion of an HTML document are used to generate additional response headers'
/*PRE_FILTER */
call lineout tempfile,'<hr><dt> <strong>PRE_FILTER</strong>:'
v.1="NO" ; v.2="YES" ; v.3="FIRST"
foo=do_radio(29,3)
call lineout tempfile,'<dd> PRE_FILTER controls whether the PREFILTR "pre-filter" is called '
call lineout tempfile,' before SRE-FILTER processes the request .'
call lineout tempfile,' <ul> <li> NO = Do not call a pre-filter '
call lineout tempfile,' <li> YES =Call a pre-filter after ascertaining logon rights'
call lineout tempfile,' <li> FIRST = Call a pre-filter before anything else </ul>'
call lineout tempfile,' If PRE_FILTER equals YES or FIRST, the PREFILTR procedure (in PREFILTR.80)'
call lineout tempfile,' will be called. SRE-FILTER comes with a sample PREFILTR that implements'
call lineout tempfile,' the GoRemote server remote control package. '
/*POST_FILTER */
call lineout tempfile,'<hr><dt> <strong>POST_FILTER</strong>:'
v.1="YES" ; v.2="NO"
foo=do_radio(28,2)
call lineout tempfile,'<dd> POST_FILTER instructs SRE-FILTER to call a "post-filter"'
call lineout tempfile,' <ul> <LI>YES = Call POSTFILT (a custom-written REXX procedure in POSTFILT.80).'
call lineout tempfile,' <LI>NO = do not call </ul>'
call lineout tempfile,' If POST_FILTER=YES, then POSTFILT will be called <strong>after</strong>'
call lineout tempfile,' the response has been sent to the client '
/*SMTP_GATEWAY */
call lineout tempfile,'<hr><dt> <strong>SMTP_GATEWAY</strong>:'
call lineout tempfile,' <INPUT TYPE="text" NAME="SMTP_GATEWAY" '
call lineout tempfile,'value="' param.31.val '"'
call lineout tempfile,' SIZE=30 MAXLENGTH=80>'
call lineout tempfile,"<dd> SMTP_GATEWAY is used by SRE-FILTER's <em>e-mail alert</em> facility "
call lineout tempfile," (contained in the default POSTFILT.80). "
call lineout tempfile,' SMTP_GATEWAY should contain the name of your SMTP mail server. <br> '
call lineout tempfile,' If you do not know it, or do not need to use e-mail alerts, leave this field empty (or set it to 0)<p>'
call lineout tempfile,' For more details on SMTP_GATEWAY, see POSTFILT.80 '
/* UPLOAD_Minfree and upload_maxsize */
call lineout tempfile,' <hr> <dt> <strong> UPLOAD_MINFREE: '
call lineout tempfile,' <INPUT TYPE="text" NAME="UPLOAD_MINFREE" '
call lineout tempfile,'value="' param.26.val '" '
call lineout tempfile,' SIZE=10 MAXLENGTH=10>'
call lineout tempfile,' , and UPLOAD_MAXSIZE: </strong>'
call lineout tempfile,' <INPUT TYPE="text" NAME="UPLOAD_MAXSIZE" '
call lineout tempfile,', value="' param.25.val '" '
call lineout tempfile,' SIZE=10 MAXLENGTH=10>'
call lineout tempfile,'<dd>'
call lineout tempfile,' The UPLOAD_ variables are needed when GET_URL is used to upload '
call lineout tempfile,' files from another server. <pr>'
call lineout tempfile,' UPLOAD_MINFREE is the amount of space (in K bytes) that must be free '
call lineout tempfile,' in the UPLOAD_DIRECTORY <em> after </em> the file has been uploaded.'
call lineout tempfile,' <br> UPLOAD_MAXSIZE is the maximum allowable size (in K bytes) of a uploaded file '
call lineout tempfile, '<p> If either of these limits are exceeded, the file will <strong> not </strong> be uploaded.'
call lineout tempfile,'</dl> '
call lineout tempfile,' <hr width=40%> '
call lineout tempfile,' <A HREF="#section0"><EM>go to top of document</EM></A> '
call lineout tempfile,' <hr width=40%> '
call lineout tempfile,' <h3> <a name="section5"> String Replacements </a> </h3>'
call lineout tempfile,' <dl> '
/* headers */
foo=""
do mm=1 to param.12.nvals
if symbol('param.12.val.mm')="VAR" then
foo=foo||param.12.val.mm||crlf
end
oo=translate(foo,' ','0')
oo=translate(oo, ' ','00090a0d'x) /* Whitespace, etc. */
if oo= " " then foo=oo
call lineout tempfile,'<p><dt> <strong>HEADERS.</strong>:'
call lineout tempfile,' <TEXTAREA NAME="'||param.12||'." ROWS=4 COLS=25>'
call lineout tempfile,foo
call lineout tempfile,'</TEXTAREA>'
call lineout tempfile,'<dd> HEADERS. are added to the top of all requested HTML '
call lineout tempfile,' documents (they are added just after the first <BODY> tag).'
call lineout tempfile,' You should enter valid HTML code in this box '
call lineout tempfile,' (or leave it blank if you do not want a HEADER added). '
call lineout tempfile,' Note that HEADERS can contain keyphrases. '
/* footers */
foo=""
do mm=1 to param.13.nvals
if symbol('param.13.val.mm')="VAR" then
foo=foo||param.13.val.mm||crlf
end
oo=translate(foo,' ','0')
oo=translate(oo, ' ','00090a0d'x) /* Whitespace, etc. */
if oo= " " then foo=oo
call lineout tempfile,'<hr><dt> <strong>FOOTERS.</strong>:'
call lineout tempfile,' <TEXTAREA NAME="'||param.13||'." ROWS=4 COLS=25>'
call lineout tempfile,foo
call lineout tempfile,'</TEXTAREA>'
call lineout tempfile,'<dd> FOOTERS. are added to the top of all requested HTML '
call lineout tempfile,' documents (they are added just before the last </BODY> tag).'
call lineout tempfile,' You should enter valid HTML code in this box '
call lineout tempfile,'(or leave it blank if you do not want a FOOTER added). '
call lineout tempfile,' Note that FOOTERS can contain keyphrases. '
/* inhouse. */
foo=""
do mm=1 to param.14.nvals
if symbol('param.14.val.mm')="VAR" then
foo=foo||param.14.val.mm||crlf
end
oo=translate(foo,' ','0')
oo=translate(oo, ' ','00090a0d'x) /* Whitespace, etc. */
if oo= " " then foo=oo
call lineout tempfile,'<hr><dt> <strong>INHOUSE.</strong>:'
call lineout tempfile,' <TEXTAREA NAME="'||param.14||'." ROWS=4 COLS=65>'
call lineout tempfile,foo
call lineout tempfile,'</TEXTAREA>'
call lineout tempfile,'<dd> The INHOUSE. variable(s) are used by the REPLACE INHOUSE.n keyphrase'
call lineout tempfile,' Each line of this box corresponds to a different value of n '
call lineout tempfile,' -- the first line is for INHOUSE.1, the second for INHOUSE.2, etc.'
/* SUPERUSER. */
foo=""
do mm=1 to param.15.nvals
if symbol('param.15.val.mm')="VAR" then
foo=foo||param.15.val.mm||crlf
end
oo=translate(foo,' ','0')
oo=translate(oo, ' ','00090a0d'x) /* Whitespace, etc. */
if oo= " " then foo=oo
call lineout tempfile,'<hr><dt> <strong>SUPERUSER.</strong>:'
if strip(foo)=0 then foo=" "
call lineout tempfile,' <TEXTAREA NAME="'||param.15||'." ROWS=4 COLS=65>'
call lineout tempfile,foo
call lineout tempfile,'</TEXTAREA>'
call lineout tempfile,'<dd> The SUPERUSER. variable(s) are used by the REPLACE SUPERUSER.n keyphrase'
call lineout tempfile,' Each line of this box corresponds to a different value of n '
call lineout tempfile,' -- the first line is for SUPERUSER.1, the second for SUPERUSER.2, etc.'
/* webmaster */
call lineout tempfile,'<hR><dt> <strong>WEBMASTER</strong>:'
call lineout tempfile, ' <TEXTAREA NAME="WEBMASTER" ROWS=1 COLS=68>' param.16.val
call lineout tempfile, ' </TEXTAREA>'
call lineout tempfile,'<dd>'
call lineout tempfile,' The WEBMASTER variable is used in the REPLACE WEBMASTER keyphrase,'
call lineout tempfile,' and is used in some internally generated messages. It should contain'
call lineout tempfile,' a contact address (preferably as a MAILTO URL) of the site''s "webmaster"'
/*HOME_NAME */
call lineout tempfile,'<hR><dt> <strong>HOME_NAME</strong>:'
call lineout tempfile,' <INPUT TYPE="text" NAME="HOME_NAME" '
call lineout tempfile,'value="' param.17.val '"'
call lineout tempfile,' SIZE=30 MAXLENGTH=80>'
call lineout tempfile,'<dd>'
call lineout tempfile,' HOME_NAME is used in the REPLACE HOME_NAME keyphrase, and is'
call lineout tempfile,' used in the default Not Found response (see below). It should contain the '
call lineout tempfile,' commonly-used name of your organization (not necessarily the IP name!)'
/*INHOUSE_NAME */
call lineout tempfile,'<hR><dt> <strong>INHOUSE_NAME</strong>:'
call lineout tempfile,' <INPUT TYPE="text" NAME="INHOUSE_NAME" '
call lineout tempfile,'value="' param.18.val '"'
call lineout tempfile,' SIZE=30 MAXLENGTH=80>'
call lineout tempfile,'<dd>'
call lineout tempfile,' INHOUSE_NAME is used in some internally generated messages.'
call lineout tempfile,' It should contain a brief (not necessarily IP) name of your "domain"'
call lineout tempfile,' Note that HOME_NAME is the name that the general public should know you by,'
call lineout tempfile,' while the INHOUSE_NAME '
call lineout tempfile,' is more of a "name of a common group of Web Users". The difference is subtle,'
call lineout tempfile,' and one could use the same value for both variables. '
/*MESS_HIT_LINE */
call lineout tempfile,'<hR><dt> <strong>MESS_HIT_LINE</strong>:'
call lineout tempfile,' <INPUT TYPE="text" NAME="MESS_HIT_LINE" '
call lineout tempfile,'value="' param.19.val '"'
call lineout tempfile,' SIZE=30 MAXLENGTH=80>'
call lineout tempfile,'<dd> MESS_HIT_LINE is used by the REPLACE OPTION_HITS.n keyphrase'
/*NOT_FOUND_URL */
call lineout tempfile,'<hR><dt> <strong>NOT_FOUND_URL</strong>:'
call lineout tempfile, ' <TEXTAREA NAME="NOT_FOUND_URL" ROWS=1 COLS=60>' param.20.val
call lineout tempfile, ' </TEXTAREA>'
call lineout tempfile,'<dd> NOT_FOUND_URL is a string that is displayed when a Not Found '
call lineout tempfile,' response is generated (say, when a requested file can not be found).'
call lineout tempfile,' Typically it will contain a link to your home page, or some other ';
call lineout tempfile,' "catchall" document. Note that HOME_NAME is used in the default '
call lineout tempfile,' definition of NOT_FOUND_URL '
call lineout tempfile,' </dl> ' /* END OF PARAMTERS LIST */
call lineout tempfile,' <A HREF="#section0"><EM>go to top of document</EM></A> '
/* === File info SECTION === */
call lineout tempfile,'<hr> <h3> <a name="section6"> File & Directory Names </a> </h3>'
call lineout tempfile,'<dl> <dt> <br> ' fd.1 ' = '
call lineout tempfile,'<INPUT TYPE="text" NAME="'||fd.1||'" VALUE="'||fd.1.val||'" '
call lineout tempfile,' SIZE=30 MAXLENGTH=60>'
Call lineout tempfile,' <dd> The MESSBOX_DIR is where the SRE-FILTER message boxes are stored'
call lineout tempfile,'<dt> <br> ' fd.2 ' = '
call lineout tempfile,'<INPUT TYPE="text" NAME="'||fd.2||'" VALUE="'||fd.2.val||'" '
call lineout tempfile,' SIZE=30 MAXLENGTH=60>'
Call lineout tempfile,' <dd> The TEMPFILE_DIR is where "transient" files should be created '
call lineout tempfile,'<dt> <br> ' fd.11 ' = '
call lineout tempfile,'<INPUT TYPE="text" NAME="'||fd.11||'" VALUE="'||fd.11.val||'" '
call lineout tempfile,' SIZE=30 MAXLENGTH=60>'
Call lineout tempfile,' <dd> The UPLOAD_DIR is where "uploaded" files will be put. '
call lineout tempfile,'<dt> <br> ' fd.13 ' = '
call lineout tempfile,'<INPUT TYPE="text" NAME="'||fd.13||'" VALUE="'||fd.13.val||'" '
call lineout tempfile,' SIZE=30 MAXLENGTH=60>'
Call lineout tempfile,' <dd> The CGI_BIN_DIR is where "CGI-BIN" programs should be stored. '
call lineout tempfile,'<dt> <br> ' fd.3 ' = '
call lineout tempfile,'<INPUT TYPE="text" NAME="'||fd.3||'" VALUE="'||fd.3.val||'" '
call lineout tempfile,' SIZE=30 MAXLENGTH=60>'
Call lineout tempfile,' <dd> The COUNTER_FILE is where the REPLACE HITS and REPLACE COUNTS '
call lineout tempfile,' keyphrases store the "number of hits" statistics. '
call lineout tempfile,'<dt> <br> ' fd.4 ' = '
call lineout tempfile,'<INPUT TYPE="text" NAME="'||fd.4||'" VALUE="'||fd.4.val||'" '
call lineout tempfile,' SIZE=30 MAXLENGTH=60>'
Call lineout tempfile,' <dd> The RECORD_ALL_FILE is where the RECORD_OPTIONS stores the '
call lineout tempfile,' "number of hits " statistics. '
call lineout tempfile,'<dt> <br> ' fd.5 ' = '
call lineout tempfile,'<INPUT TYPE="text" NAME="'||fd.5||'" VALUE="'||fd.5.val||'" '
call lineout tempfile,' SIZE=30 MAXLENGTH=60>'
Call lineout tempfile,' <dd> The SENDFILE_FILE is where the SENDFILE facility stores "number of hits"'
call lineout tempfile,' statistics" and access information '
call lineout tempfile,'<dt> <br> ' fd.12 ' = '
call lineout tempfile,'<INPUT TYPE="text" NAME="'||fd.12||'" VALUE="'||fd.12.val||'" '
call lineout tempfile,' SIZE=30 MAXLENGTH=60>'
Call lineout tempfile,' <dd> The UPLOAD_LOG is where information on uploaded files '
call lineout tempfile,' will be stored. If you do not want to store such info, enter <strong>0</strong> '
call lineout tempfile,'<dt> <br> ' fd.6 ' = '
call lineout tempfile,'<INPUT TYPE="text" NAME="'||fd.6||'" VALUE="'||fd.6.val||'" '
call lineout tempfile,' SIZE=30 MAXLENGTH=60>'
Call lineout tempfile,' <dd> The ACCESS_FILE is where ALLOW_ACCESS looks for action-specific'
call lineout tempfile,' access information'
call lineout tempfile,'<dt> <br> ' fd.7 ' = '
call lineout tempfile,'<INPUT TYPE="text" NAME="'||fd.7||'" VALUE="'||fd.7.val||'" '
call lineout tempfile,' SIZE=30 MAXLENGTH=60>'
Call lineout tempfile,' <dd> The ALIAS_FILE contains the lists of ALIASES '
call lineout tempfile,'<dt> <br> ' fd.14 ' = '
call lineout tempfile,'<INPUT TYPE="text" NAME="'||fd.14||'" VALUE="'||fd.14.val||'" '
call lineout tempfile,' SIZE=30 MAXLENGTH=60>'
Call lineout tempfile,' <dd> The VIRTUAL_FILE contains the "virtual directory" list '
call lineout tempfile,'<dt> <br> ' fd.8 ' = '
call lineout tempfile,'<INPUT TYPE="text" NAME="'||fd.8||'" VALUE="'||fd.8.val||'" '
call lineout tempfile,' SIZE=30 MAXLENGTH=60>'
Call lineout tempfile,' <dd> The REPSTRGS_FILE contains the list of custom "variable names" '
call lineout tempfile,' for use by the REPLACE keyphrase '
call lineout tempfile,'<dt> <br> ' fd.9 ' = '
call lineout tempfile,'<INPUT TYPE="text" NAME="'||fd.9||'" VALUE="'||fd.9.val||'" '
call lineout tempfile,' SIZE=30 MAXLENGTH=60>'
Call lineout tempfile,' <dd> The USER_FILE contains logon/password/privileges information '
call lineout tempfile,'<dt> <br> ' fd.10 ' = '
call lineout tempfile,'<INPUT TYPE="text" NAME="'||fd.10||'" VALUE="'||fd.10.val||'" '
call lineout tempfile,' SIZE=30 MAXLENGTH=60>'
Call lineout tempfile,' <dd> The INTERPRET_FILE contains the "REXX-code blocks" used by the '
call lineout tempfile,' INTERPRET keyphrase '
call lineout tempfile,'</dl>' /* end OF FILE INFO SECTION */
call lineout tempfile,' <A HREF="#section0"><EM>go to top of document</EM></A> '
/* and keep track of the nochangers */
do bob=1 to nno
DOG=NOCHANGERS.BOB
if dog=" " then iterate
DOG=sref_REPLACESTRG(DOG,'"','%22','ALL')
DOG=sref_REPLACESTRG(DOG,"'",'%27','ALL')
DOG=sref_REPLACESTRG(DOG,"+",'%2B','ALL')
DOG=sref_REPLACESTRG(DOG,"<",'%3c','ALL')
DOG=sref_REPLACESTRG(DOG,">",'%3e','ALL')
DOG=translate(DOG,"+",' ')
call lineout tempfile,'<INPUT TYPE="hidden" NAMe="NOCHANGE" value="'||DOG||'" >'
end
call lineout tempfile,'<p> <EM>if you are done you can</EM> <INPUT TYPE="submit" VALUE="make the changes">,'
call lineout tempfile,' <EM>or you can </EM><INPUT TYPE="reset" VALUE="reset to current values">'
call lineout tempfile,'</FORM>'
call lineout tempfile,' <hr> </body> </html> '
call lineout tempfile
end
return 'FILE ERASE TYPE text/html NAME' tempfile
/****************************************************/
/* JUMP HERE ON POST CALLS, which are always "write info" calls */
/* you should never need to modify this */
write_It: nop
crlf = '0d0a'x
call lineout tempfile, '<!doctype html public "-//IETF//DTD HTML 3.0//EN">'
call lineout tempfile, "<html><head><title>FILTINST Results </title>"
call lineout tempfile, "</head><body>"
call lineout tempfile,' <h1> SRE-FILTER Configurator </h1> '
foo=stream(afile,'c','query exists')
if foo="" then
call lineout tempfile,' Warning: Old INITFILT.'aport ' did not exist '
else do
/* rename current initfilt.80 */
/* see what old initifits there are */
afile2="INITFILT.B10" /* use in case of weirdness */
afilexx=basedir||'\INITFILT.B*'
rc=sysfiletree(afilexx,initfils,'FT')
select
when rc<>0 then do /* error, just use .b1 */
afile2=basedir||'\INITFILT.B1'
say " INITFILT backup: SysFileTree error, using INITFILT.B1 "
end
when initfils.0=0 then do
say " Creating first backup of INITFILT"
afile2=basedir||'\INITFILT.B1'
end
when initfils.0 >= 10 then do /* delete oldest */
isold=translate(word(iniTfils.1,1),'jihgfedcba','9876543210')
aname=word(initfils.1,4) ; aname3=aname
ISOLD1=1
do mm=2 to iniTfils.0
adate=translate(word(iniTfils.mm,1),'jihgfedcba','9876543210')
aname=word(iniTfils.mm,4)
if adate<isold then do
isold=adate ; isold1= mm ; aname3=aname
end
end
afile2=aname3
Say " Backup INITFILT using oldest " aname3
end
otherwise do /* find first missing number from 1... 10 */
do oy=1 to 10 ; alist.oy=0 ; end
do ji=1 to initfils.0
aname=word(iniTfils.ji,4)
do oy=1 to 10
oy2=".B"||oy
if pos(oy2,translate(aname))>0 then do
alist.oy=1
leave
end
end
end
do ji=1 to 10
if alist.ji=1 then iterate
hoy=".B"||ji
afile2=basedir||"\INITFILT"||hoy
say " Backup INITFILT using " afile2
leave
end
end
end /* select */
/* now copy old initfilt.80 to afile2 */
goo=charin(afile,1,chars(afile))
ause=stream(afile,'c','close')
ause=stream(afile2,'c','OPEN WRITE') /* write out results */
if ause>0 then do
foo=charout(afile2,goo,1)
end
ause=stream(afile2,'c','close')
foo=sysfiledelete(afile)
if foo<>0 then do
call lineout tempfile,'<p> Error, could not remove old INITFILT.'aport ' file (rc= ' foo
signal alldone
end
else
call lineout tempfile,' <p> Old INITFILT.'aport ' is now ' afile2
end
/* Check for arguments. Note that if no arguments, error. */
igot=0 ; notc=0
do until list = ""
parse var list anopt '&' list
anopt=packur(anopt)
parse var anopt aname '=' aval
if pos('.',aname)=0 then do
select
when translate(aname)="COMMENT" then
thecomment=aval
when translate(aname)="NOCHANGE" then do
aval=translate(aval,' ','+'||'090a0d'x)
AVAL=PACKUR(AVAL)
IF AVAL= " " THEN ITERATE
notc=notc+1
nochan.notc=aval
END
otherwise do
aval=translate(aval,' ','+'||'090a0d'x)
AVAL=PACKUR(AVAL)
igot=igot+1
llist.igot=aname||"="||" '"||aval||"' "
end
end /*select */
end
else do /* a stem var? */
iboy=0
do until aval=""
parse var aval avalu (crlf) aval
avalu=strip(translate(avalu, ' ','00090d0a'x))
AVALu=PACKUR(AVALu)
if avalu="" then iterate
iboy=iboy+1
igot=igot+1
llist.igot=aname||iboy||"= '"||avalu||"' "
end
if iboy=0 then do /* empy, given it a value of 0 */
igot=igot+1
llist.igot=aname||"1=0 "
end
end /* stem var */
end
/* double check for errors */
itisbad=0
do kk=1 to igot
writeme=check_it_out(llist.kk)
if itisbad=1 then do
call lineout tempfile,'<p><strong> Warning: </strong>Error at: ' llist.kk
call lineout tempfile,' <br><em> You should rerun FILTINST and correct it! </em>'
end
badguys=itisbad
call lineout afile,writeme
end
call lineout afile,' '
do mm=1 to nOTC
call LINEOUT AFILE,NOCHAN.MM
END
alldone:
call lineout tempfile,' <hr> </body> </html> '
call lineout tempfile
return 'FILE ERASE TYPE text/html NAME' tempfile
*****/
check_it_out: procedure expose itisbad
parse arg thang
itisbad=0
signal on syntax name badline /* ugly4 down below */
interpret thang
signal okayline
badline:
signal off syntax
itisbad=1
okayline: nop
if itisbad=0 then
dog=thang
else
dog='/* '|| thang || ' */'
return dog
/**********/
/* --- create a row of radio buttons */
do_radio: procedure expose param. v. tempfile
parse arg ith,inlist
do mm=1 to inlist
if v.mm=param.ith.val then do
v2.mm="CHECKED"
isit=mm
end
else do
v2.mm=' '
end
end
do mm=1 to inlist
call lineout tempfile,' <INPUT TYPE=RADIO NAME="'||param.ith||'" '
call lineout tempfile,' VALUE="' ||v.mm|| '" ' ||v2.mm|| '>' v.mm ' , '
end
return isit
/***************/
/* write out values for a variable (or a stem variable ) */
write_1:
parse arg iat
ndo=param.iat.nvals
if ndo=0 then do /*not a stem var */
call lineout tempfile, " <b>" param.iat "</b> =<tt> " param.iat.val '</tt> <br>'
end
else do
do jmm2=1 to ndo
call lineout tempfile, " <b>" param.iat "." jmm2
if symbol('PARAM.IAT.VAL.JMM2')='VAR' then
call lineout tempfile, "</b> =<tt> " param.iat.val.jmm2 '</tt> <br>'
ELSE
call lineout tempfile, "</b> =<EM> missing! </em> <br>"
end
end
return 1